package yhao.infra.feature.alipay.core.request.query;

import com.alipay.api.AlipayApiException;
import com.alipay.api.request.AlipayTradeFastpayRefundQueryRequest;
import com.alipay.api.response.AlipayTradeFastpayRefundQueryResponse;
import yhao.infra.feature.alipay.core.request.BaseRefundRequest;

/**
 * 统一收单交易退款查询
 * @see <a href="https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query/">更多细节</a>
 */
public class RefundQueryRequest extends BaseRefundRequest<AlipayTradeFastpayRefundQueryResponse> {
    public RefundQueryRequest(String out_trade_no, String out_request_no) {
        super(out_trade_no,out_request_no);
    }

    @Override
    protected AlipayTradeFastpayRefundQueryResponse doRequest() {
        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
        request.setBizContent(bizContent);

        String method = logRequest(request);
        try {
            return alipayClient.execute(request);
        } catch (AlipayApiException e) {
            logger.error(method+getOut_trade_no(), e.getMessage());
        }
        return null;
    }
}
